//
//  KABMallModel.m
//  kabu
//
//  Created by XiangDongMBP on 2017/2/10.
//  Copyright © 2017年 East. All rights reserved.
//

#import "KABMallModel.h"
#import "UIColor+XDHex.h"
#import "GlobalHeader.h"

@implementation KABMallHpListItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"hpId" : @"mallhomepage_id",
             @"title" : @"mallhomepage_title",
             @"subtitle" : @"mallhomepage_subtitle",
             @"cover_img_url" : @"mallhomepage_cover_img_url",
             @"link_url" : @"mallhomepage_link_url",
             @"link_type" : @"mallhomepage_link_type",
             @"type_id" : @"mallhomepage_mallhomepagetype_id"};
}
@end
@implementation KABMallHpItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"typeId" : @"mallhomepagetype_id",
             @"icon_url" : @"mallhomepagetype_icon_url",
             @"content" : @"mallhomepagetype_content"};
}
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"list" : [KABMallHpListItem class]};
}
@end
@implementation KABMallHomepage
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"homepage_list" : [KABMallHpItem class]};
}
@end


@implementation KABMallBannerItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"bannerId" : @"id"};
}
@end
@implementation KABMallBannerList
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"banner_list" : [KABMallBannerItem class]};
}

- (NSArray<NSString *> *)bannerImgUrlArray {
    NSMutableArray *mArray = [NSMutableArray arrayWithCapacity:self.banner_list.count];
    [self.banner_list enumerateObjectsUsingBlock:^(KABMallBannerItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [mArray addObject:obj.image_url];
    }];
    return mArray;
}

@end



@implementation KABMallProListItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"productId" : @"id"};
}
@end
@implementation KABMallProductList
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_list" : [KABMallProListItem class]};
}
- (BOOL)totalLoad {
    return (self.product_list.count >= self.total_rows);
}
- (void)addMoreWithData:(KABMallProductList *)temp {
    self.total_rows = temp.total_rows;
    [self.product_list addObjectsFromArray:temp.product_list];
}
@end



@implementation KABProModelListItem
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"model_id" : @"id",
             @"content"  : @[@"content", @"model_content"]};
}
@end
@implementation KABProductProItem
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"property_content" : @[@"property_content", @"content"],
             @"property_id" : @[@"property_id", @"id"]};
}
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"model_list" : [KABProModelListItem class]};
}
@end
@implementation KABProSkuListItem
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"sku_id" : @[@"sku_id", @"product_sku_id"]};
}
@end
@implementation KABProDetailImgItem
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"detImgId" : @"id"};
}
@end
@implementation KABMallProDetail
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"shoppingcart_id" : @[@"shoppingcart_id", @"id"],
             @"product_id" : @[@"product_id", @"id"],
             @"product_name" : @[@"product_name",@"name"],
             @"product_cover_image_url" : @[@"product_cover_image_url", @"cover_image_url"],
             @"sku_list" : @[@"sku_list", @"product_sku_list"]};
}
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_property_list" : [KABProductProItem class],
             @"sku_list" : [KABProSkuListItem class],
             @"detail_image_list" : [KABProDetailImgItem class],
             @"introduce_image_list" : [KABProDetailImgItem class]};
}
//- (BOOL)modelCustomTransformToDictionary:(NSMutableDictionary *)dic {
//    return YES;
//}

- (NSString *)selPropertyStr {
    NSMutableString *mStr = [NSMutableString string];
    for (KABProductProItem *item in self.product_property_list) {
        for (KABProModelListItem *model in item.model_list) {
            if (item.model_id == model.model_id) {
                [mStr appendFormat:@"%@:%@;", item.property_content, model.content];
            }
        }
    }
    if (mStr.length) {
        [mStr deleteCharactersInRange:NSMakeRange(mStr.length - 1, 1)];
    }
    NSLog(@"已选择的属性 %@", mStr);
    return mStr;
}
- (NSInteger)selOriginalPrice {
    KABProSkuListItem *item = [self selSkuListItem];
    if (item) {
        return item.original_price;
    }
    
    return self.sku_list.firstObject.original_price;
}

- (NSInteger)selStock {
    KABProSkuListItem *item = [self selSkuListItem];
    if (item) {
        return item.stock;
    }
    
    return self.sku_list.firstObject.stock;
}

- (NSString *)selSkuId {
    KABProSkuListItem *item = [self selSkuListItem];
    return item.sku_id;
}

- (KABProSkuListItem *)selSkuListItem {
    NSMutableString *mStr = [NSMutableString stringWithFormat:@"%zd_", self.product_id];
    for (KABProductProItem *item in self.product_property_list) {
        for (KABProModelListItem *model in item.model_list) {
            if (item.model_id == model.model_id) {
                [mStr appendFormat:@"%zd:%zd_", item.property_id, model.model_id];
            }
        }
    }
    if (mStr.length) {
        [mStr deleteCharactersInRange:NSMakeRange(mStr.length - 1, 1)];
    }
    
    for (KABProSkuListItem *skuItem in self.sku_list) {
        if ([skuItem.sku_id isEqualToString:mStr]) {
            return skuItem;
        }
    }
    
    return nil;
}
- (BOOL)hasSelModel {
    __block BOOL hasSel = YES;
    [self.product_property_list enumerateObjectsUsingBlock:^(KABProductProItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.model_id == 0) {
            hasSel = NO;
            *stop = YES;
        }
    }];
    return hasSel;
}
- (NSArray<NSString *> *)bannerImgUrlArray {
    NSMutableArray *mArray = [NSMutableArray arrayWithCapacity:self.detail_image_list.count];
    [self.detail_image_list enumerateObjectsUsingBlock:^(KABProDetailImgItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [mArray addObject:obj.image_url];
    }];
    return mArray;
}

- (void)skuIdTransToModelId {
    if (!self.product_sku_id.length) {
        NSLog(@"skuIdTransToModelId error!(product_sku_id = %@)", self.product_sku_id);
        return;
    }
    
    NSArray *array = [self.product_sku_id componentsSeparatedByString:@"_"];
    for (NSInteger i = 1; i < array.count; i++) {
        NSString * per_model_str = array[i];
        NSArray *subArray = [per_model_str componentsSeparatedByString:@":"];
        if (subArray.count == 2) {
            NSInteger propertyId = [subArray.firstObject integerValue];
            NSInteger modelId = [subArray.lastObject integerValue];
            [self setPropertyId:propertyId modelId:modelId];
        }
    }
}
- (void)setPropertyId:(NSInteger)propertyId modelId:(NSInteger)modelId {
    [self.product_property_list enumerateObjectsUsingBlock:^(KABProductProItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.property_id == propertyId) {
            obj.model_id = modelId;
            *stop = YES;
        }
    }];
}
- (void)modelIdMergeToSkuId {
    self.product_sku_id = [self selSkuId];
}

@end



//@implementation KABMallShoCarProItem
//+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
//    return @{@"model_list" : [KABProModelListItem class]};
//}
//@end
//@implementation KABMallShopCartItem
//+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
//    return @{@"shoppingcart_id" : @"id"};
//}
//+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
//    return @{@"product_property_list" : [KABMallShoCarProItem class]};
//}
//@end
@implementation KABMallShopCartModel
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_list" : [KABMallProDetail class]};
}
- (NSInteger)selProductCnt {
    __block NSInteger num = 0;
    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.isSelected) {
            ++num;
        }
    }];
    return num;
}
- (NSInteger)wholeSelOriginalPrice {
    __block NSInteger count = 0;
    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.isSelected) {
            count += (obj.number * obj.selOriginalPrice);
        }
    }];
    return count;
}
- (NSInteger)wholeSelTotalPrice {
    NSInteger total = 0;
    for (NSInteger i = 0; i < self.sortList.count; i++) {
        total += [self totalPriceWithIndex:i];
    }
    return total;
}
- (void)sortWithSameShop {
    NSMutableArray<NSMutableArray<KABMallProDetail *> *> *mArray = [NSMutableArray array];
    for (KABMallProDetail *item in self.product_list) {
        BOOL isSame = NO;
        for (NSMutableArray *shopArray in mArray) {
            KABMallProDetail *shopItem = shopArray.firstObject;
            if (shopItem.shop_id == item.shop_id) {
                [shopArray addObject:item];
                isSame = YES;
                break;
            }
        }
        if (!isSame) {
            NSMutableArray *shopMArray = [NSMutableArray arrayWithObject:item];
            [mArray addObject:shopMArray];
        }
    }
    self.sortList = mArray;
}
- (void)transSkuIdToModelId {
    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [obj skuIdTransToModelId];
    }];
}
- (BOOL)isWholeSelectedWithIndex:(NSInteger)index {
    __block BOOL result = YES;
    if (index < self.sortList.count) {
        NSArray<KABMallProDetail *> *array = self.sortList[index];
        [array enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if (!obj.isSelected) {
                result = NO;
                *stop = YES;
            }
        }];
    }
    return result;
}
- (void)setWholeSelected:(BOOL)isSel withIndex:(NSInteger)index {
    if (index < self.sortList.count) {
        NSArray<KABMallProDetail *> *array = self.sortList[index];
        [array enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            obj.isSelected = isSel;
        }];
    }
}

- (BOOL)isWholeSelected {
    if (!self.product_list.count) {
        return NO;
    }
    
    for (NSInteger i = 0; i < self.sortList.count; ++i) {
        if (![self isWholeSelectedWithIndex:i]) {
            return NO;
        }
    }
    return YES;
}
- (void)setWholeSelected:(BOOL)isSel {
    for (NSInteger i = 0; i < self.sortList.count; ++i) {
        [self setWholeSelected:isSel withIndex:i];
    }
}
- (NSInteger)originalPriceWithIndex:(NSInteger)index {
    __block NSInteger total = 0;
    if (index < self.sortList.count) {
        NSArray<KABMallProDetail *> *array = self.sortList[index];
        [array enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            total += (obj.selOriginalPrice * obj.number);
        }];
    }
    return total;
}
- (NSInteger)freightWithIndex:(NSInteger)index {
    __block NSInteger maxFreight = 0;
    if (index < self.sortList.count) {
        NSArray<KABMallProDetail *> *array = self.sortList[index];
        [array enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            maxFreight = MAX(maxFreight, obj.freight);
        }];
    }
    return maxFreight;
}
- (NSInteger)totalPriceWithIndex:(NSInteger)index {
    NSInteger originalPrice = [self originalPriceWithIndex:index];
    NSInteger maxFreight = [self freightWithIndex:index];
    
    // 这里需要加上最大的运费
    return originalPrice + maxFreight;
}
- (NSInteger)totalProductCntWithIndex:(NSInteger)index {
    __block NSInteger total = 0;
    if (index < self.sortList.count) {
        NSArray<KABMallProDetail *> *array = self.sortList[index];
        [array enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            total += obj.number;
        }];
    }
    return total;
}
- (NSAttributedString *)desAttributeStrWithIndex:(NSInteger)index {
    if (index >= self.sortList.count) {
        return nil;
    }
    NSString *str1 = [NSString stringWithFormat:@"共%zd件商品 合计：", [self totalProductCntWithIndex:index]];
    NSInteger totalPrice = [self totalPriceWithIndex:index];
    NSString *price1 = [NSString stringWithFormat:@"￥%.2f", totalPrice / 100.0];
    NSInteger maxFreight = [self freightWithIndex:index];
    NSString *totalStr = [NSString stringWithFormat:@"%@%@ (含运费￥%.2f)", str1, price1, maxFreight / 100.0];
    NSMutableAttributedString *mAStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
    NSDictionary *dic = @{NSForegroundColorAttributeName : [UIColor xd_colorWithHex:0xC8A775],
                          NSFontAttributeName : [UIFont systemFontOfSize:18.0]};
    [mAStr addAttributes:dic range:NSMakeRange(str1.length, price1.length)];
    return mAStr;
}
- (NSArray<KABMallProDetail *> *)selectProductArray {
    NSMutableArray *mArray = [NSMutableArray array];
    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.isSelected) {
            [mArray addObject:obj];
        }
    }];
    return mArray;
}
- (NSArray<NSNumber *> *)selectShoppingcartIdArray {
    NSMutableArray *mArray = [NSMutableArray array];
    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        if (obj.isSelected) {
            [mArray addObject:@(obj.shoppingcart_id)];
        }
    }];
    
    return mArray;
}
- (void)deleteSelectProduct {
    NSArray *array = [self selectProductArray];
    [self.product_list removeObjectsInArray:array];
    [self sortWithSameShop];    //整理一下
}
//- (NSArray *)editOrderJson {
//    NSMutableArray *mArray = [NSMutableArray array];
//    [self.product_list enumerateObjectsUsingBlock:^(KABMallProDetail * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
//        NSDictionary * dic = @{@"" : @""};
//    }];
//}
- (NSArray *)submitOrderJsonWithReceiverId:(NSInteger)recItemId {
    NSMutableArray *mArray = [NSMutableArray arrayWithCapacity:self.sortList.count];
    for (NSArray *array in self.sortList) {
        NSMutableDictionary *mDic = [NSMutableDictionary dictionary];
        KABMallProDetail *proDetail = array.firstObject;
        [mDic setObject:@(proDetail.shop_id) forKey:@"shop_id"];
        [mDic setObject:@(recItemId) forKey:@"receiver_info_id"];
        
        NSMutableArray *product_list = [NSMutableArray arrayWithCapacity:array.count];
        for (KABMallProDetail *proItem in array) {
            NSDictionary *dic = @{@"product_id" : @(proItem.product_id),
                                  @"number" : @(proItem.number),
                                  @"product_sku_id" : proItem.selSkuId};
            [product_list addObject:dic];
        }
        [mDic setObject:product_list forKey:@"product_list"];
        
        [mArray addObject:mDic];
    }
    return mArray;
}
@end



@implementation KABMallOrdPropertyItem
@end
@implementation KABMallOrdProductItem
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"property_list" : [KABMallOrdPropertyItem class]};
}
@end
@implementation KABMallOrderDetail
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_list" : [KABMallOrdProductItem class]};
}
- (NSInteger)total_number {
    __block NSInteger cnt = 0;
    [self.product_list enumerateObjectsUsingBlock:^(KABMallOrdProductItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        cnt += obj.number;
    }];
    return cnt;
}
@end

@implementation KABMallOrderList
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"order_list" : [KABMallOrderDetail class]};
}
- (BOOL)totalLoad {
    return (self.order_list.count >= self.total_rows);
}
- (void)addMoreWithData:(KABMallOrderList *)temp {
    self.total_rows = temp.total_rows;
    [self.order_list addObjectsFromArray:temp.order_list];
}
@end


@implementation KABMallSubOrdBackDetail
//+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
//    return @{@"order_list" : [NSString class]};
//}
@end
@implementation KABMallWxPayPars
@end
@implementation KABMallSubOrdBackModel
@end


@implementation KABMallModel
@end




@implementation KABMallProSubTyepItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"subTypeId" : @"id"};
}
@end
@implementation KABMallProShopListItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }
@end
@implementation KABMallProTypeItem
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"typeId" : @"id",
             @"product_subtype_list" : @[@"product_subtype_list", @"product_sub_type_list"]};
}
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_subtype_list" : [KABMallProSubTyepItem class],
             @"shop_list" : [KABMallProShopListItem class]};
}
- (BOOL)totalLoad {
    return (self.shop_list.count >= self.total_rows);
}
- (void)addMoreWithData:(KABMallProTypeItem *)temp {
    self.total_rows = temp.total_rows;
    [self.shop_list addObjectsFromArray:temp.shop_list];
}
- (void)refreshWithData:(KABMallProTypeItem *)temp {
    self.product_subtype_list = temp.product_subtype_list;
    self.total_rows = temp.total_rows;
    self.shop_list = temp.shop_list;
}
- (KABMallProTypeItem *)proTypeItemWithDictionary:(NSDictionary *)dic isAddMore:(BOOL)addMore {
    if ([dic[KABGlobalJsonKeyErrCode] integerValue] != 200) {
        return self;
    }
    
    KABMallProTypeItem *temp = [KABMallProTypeItem yy_modelWithDictionary:dic[KABGlobalJsonKeyResult]];
    if (!temp) {
        return self;
    }
    
    if (addMore && self) {
        [self addMoreWithData:temp];
    } else {
        [self refreshWithData:temp];
    }
    return self;
}
@end
@implementation KABMallProductType
- (void)encodeWithCoder:(NSCoder *)aCoder { [self yy_modelEncodeWithCoder:aCoder]; }
- (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super init]; return [self yy_modelInitWithCoder:aDecoder]; }

+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_type_list" : [KABMallProTypeItem class]};
}
@end



@implementation KABMallShopBannerItem
+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper {
    return @{@"bannerId" : @"id"};
}
@end
@implementation KABMallShopDetInfo
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"shop_banner" : [KABMallShopBannerItem class]};
}
@end
@implementation KABMallShopDetail
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"product_list" : [KABMallProListItem class]};
}
- (BOOL)totalLoad {
    return (self.product_list.count >= self.total_rows);
}
- (void)addMoreWithData:(KABMallShopDetail *)temp {
    self.shop_detail = temp.shop_detail;
    self.total_rows = temp.total_rows;
    [self.product_list addObjectsFromArray:temp.product_list];
}
@end


@implementation KABMallShopColList
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"shop_list" : [KABMallShopDetInfo class]};
}
- (BOOL)totalLoad {
    return (self.shop_list.count >= self.total_rows);
}
- (void)addMoreWithData:(KABMallShopColList *)temp {
    self.total_rows = temp.total_rows;
    [self.shop_list addObjectsFromArray:temp.shop_list];
}
@end


@implementation KABMallLogisticItem
@end
@implementation KABMallLogisticInfo
+ (NSDictionary<NSString *,id> *)modelContainerPropertyGenericClass {
    return @{@"traces" : [KABMallLogisticItem class]};
}
@end
